package com.cmxh.shipper.service.impl;

import com.cmxh.shipper.mapper.WalletMapper;
import com.cmxh.shipper.pojo.Wallet;
import com.cmxh.shipper.service.WalletService;
import com.cmxh.shipper.util.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WalletServiceimpl implements WalletService {
    @Autowired
    private WalletMapper walletMapper;

    @Override
    public Wallet getWallet(Integer fid) {
        return walletMapper.mapWallet(fid);
    }

    @Override
    public int updatefid(Wallet wallet) {
        return walletMapper.updatefid(wallet);
    }

    @Override
    public int xiugai(Wallet wallet) {
        String encrypt = Md5Util.encrypt(wallet.getPaymentPassword());
        wallet.setPaymentPassword(encrypt);
        return walletMapper.xiugai(wallet);
    }


    @Override
    public int insert(Integer record) {
        return walletMapper.insert(record);
    }


}
